<template>
  <div>
    <van-card :title="form.strMaterialname" :desc="form.iTypename" :thumb="form.strDownload">
      <div slot="tags" class="van-card__desc van-ellipsis">{{form.strDownload}}</div>
    </van-card>
    <van-cell-group>
      <van-cell title="素材名称" :value="form.strMaterialname" />
      <van-cell title="素材编号" :value="form.strMaterialencode" />
      <van-cell title="设备类型" :value="form.iDevtypename" />
      <van-cell title="所属机构" :value="form.strOrgname" />
      <van-cell title="分辨率" :value="form.strResolution" />
      <van-cell title="操作者" :value="form.strOperator" />
    </van-cell-group>
    <van-row type="flex" justify="center" style="margin-top: 24px">
      <van-col :span="20">
        <van-button block class="vant-btn-dark" @click="modifyBtn">修改</van-button>
      </van-col>
    </van-row>
  </div>
</template>

<script>
export default {
  name: 'Details',
  data() {
    return {
      message: '输入框内容对齐',
      form: {}
    }
  },
  created() {
    // if (!this.$route.query.row) {
    this.form = JSON.parse(this.$route.query.row)
    console.log(this.form)
    // } else {
    //   this.$router.push(-1)
    // }
  },
  methods: {
    modifyBtn() {
      this.$router.push({
        path: 'addMaterial',
        query: { row: this.$route.query.row }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.van-card {
  background: #ffffff;
  .van-card__thumb {
    padding: 8px;
  }
  .van-card__title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
  }
  .van-card__desc {
    font-weight: 500;
  }
}
</style>